package no.sachmuld.methodcombination.examples.reflection.mock;

import no.sachmuld.methodcombination.api.MethodInvocation;

/**
 *
 */
public class Main implements Runnable {

    @Override
    public void run() {

        PersonDao dao = new PersonDao().with(new PersonDaoBehaviour() {
            @Override
            public Person findPersonById(int id, MethodInvocation<Person> methodInvocation) {
                return new Person("Mock Ito");
            }
        });

        Person person = dao.findPersonById(0);
        System.out.println(person.getName());

    }

    public static void main(String... args) {

        new Main().run();

    }
}
